package com.tdd;

import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;

import org.junit.Before;
import org.junit.Test;

public class PlusTest {
	HpStack stack;
	Plus plus;
	
	@Before
	public void init() {
		stack = new HpStack();
		plus = new Plus();
	}
	
	@Test
	public void addOneNumber() {
		stack.push(new BigDecimal(4));
		plus.operate(stack);
		assertEquals(4, stack.peek());
	}

	@Test
	public void addTwoNumbers() {
		stack.push(new BigDecimal(4));
		stack.push(new BigDecimal(-7));
		plus.operate(stack);
		assertEquals(-3, stack.peek());
	}
}
